package main

import "sort"

func customSortString(order string, s string) string {
	m := make(map[byte]byte)
	for i := 0; i < len(order); i++ {
		m[order[i]] = byte(i)
	}

	data := []byte(order)

	sort.Slice(data, func(i, j int) bool {
		if m[data[i]] < m[data[j]] {
			return true
		}
		return false
	})

	return string(data)
}
